<template>
	<view>
		<uni-card title="捐赠">
			<view class="u-demo-wrap" style="background-color: #FFFFFF;">
				<view class="u-demo-area">
					<u-field
						v-model="mobile"
						label="捐赠数额"
						placeholder="请填写"
					>
					</u-field>
				<button type="primary" @click="juan">捐赠</button>
				</view>
			</view>
		</uni-card>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base:api.baseurl,
				id:'',
				mobile:''
			}
		},
		onLoad(options) {
			console.log(options.id)
			this.id = options.id
		},
		methods: {
			juan(){
				this.$post(this.base+'/prod-api/api/public-welfare/donate-record',{
					activityId:this.id,
					donateMoney:this.mobile
				}).then((res)=>{
					if(res.code == 200){
						uni.showToast({
							title:'捐赠成功'
						})
						setTimeout(()=>{
							uni.navigateBack({
								
							})
						},500)
					}else{
						uni.showToast({
							title:res.msg,
							icon:'none'
						})
					}		
				})
			}
		}
	}
</script>

<style>

</style>
